package com.easy.customer.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.easy.common.bean.CustomerInteractions;
import com.easy.common.service.ICustomerInteractionsService;
import com.easy.customer.mapper.CustomerInteractionsMapper;

public class CustomerInteractionsService extends ServiceImpl<CustomerInteractionsMapper,CustomerInteractions> implements  ICustomerInteractionsService{

    @Override
    public CustomerInteractions insert(CustomerInteractions interactions) {
        super.save(interactions);
        CustomerInteractions result=super.getById(interactions.getId());
        return result;
    }

    @Override
    public CustomerInteractions update(CustomerInteractions interactions) {
        super.updateById(interactions);
        CustomerInteractions result=super.getById(interactions.getId());
        return result;
    }

    @Override
    public IPage<CustomerInteractions> getListByPage(IPage page) {
        LambdaQueryWrapper wrapper=new LambdaQueryWrapper();
        wrapper.orderByDesc("create_at");
        IPage result=super.page(page,wrapper);
        return result;
    }
}
